package com.iris.nio;

import java.net.InetSocketAddress;
import java.nio.channels.AsynchronousSocketChannel;

public class AioHandlerClient {
    public static void main(String[] args) {

        try {
            AsynchronousSocketChannel socketChannel = AsynchronousSocketChannel.open();
            AioAttach aioAttach = new AioAttach();
            aioAttach.setId("id==");
            aioAttach.setName("name==");
            AioAcceptClientHandler handler = new AioAcceptClientHandler(socketChannel);
            socketChannel.connect(new InetSocketAddress(8888),aioAttach,handler);
            while(true){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
